package com.xcdh.ittools;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.net.InetAddress;

@SpringBootApplication
@ComponentScan(basePackages = {"com.xcdh.ittools" , "com.xcdh.commons.spring" })
@EnableFeignClients("com.*.**.client")
public class XcdhITToolsApplication {

    public static void main(String[] args) {
        try {
            ConfigurableApplicationContext app = SpringApplication.run(XcdhITToolsApplication.class, args);
            String ip = InetAddress.getLocalHost().getHostAddress(); // 获取本机IP
            String port = app.getEnvironment().getProperty("server.port");
            String appName = app.getEnvironment().getProperty("spring.application.name");
            System.out.println(String.format("服务%s 启动成功 http://%s:%s",appName,ip,port));
        }catch (Exception e){
            e.printStackTrace();
        }

    }

}
